<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/admin/jsp/taglibs.jsp"%>
<html>
	<head>
		<%@ include file="/admin/jsp/header.jsp"%>
		<%@ include file="/framework/jsp/tablesorter.jsp"%>
	</head>
	<body onload="init();">
		<table width="98%" border="0" align="center" cellpadding="3" cellspacing="0">
			<tr>
				<td class="page-title">
					<img src="../images/page_title.gif" alt="title" width="17" height="12">
					&nbsp;&nbsp; 系统管理 » 接口管理





				</td>
			</tr>
		</table>
		<br>
		<form id="mainForm" action="/admin/jsp/sysCom.do?method=querySysCom" method="post">
			<input type="hidden" name="pageNo" id="pageNo" value="${page.pageNo}" />
			<input type="hidden" name="pageSize" id="pageSize" value="${page.pageSize}" />
			<input type="hidden" name="orderBy" id="orderBy" value="${page.orderBy}" />
			<input type="hidden" name="order" id="order" value="${page.order}" />
			<fieldset style="width: 98%; padding: 10px">
				<legend>
					接口查询




				</legend>
				<table width="80%" height="50" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td>
							接口名称:
							<input name="filter_LIKE_comName" id="comName" value='<c:out value="${param['filter_LIKE_comName']}"/>'>
						</td>
						<td>
							接口类型:
							<select name="filter_EQ_comType" id="comType">
								<option value="">--请选择--</option>
								<option value="1">DSMP接口</option>
								<option value="2">彩信中心接口</option>
								<option value="3">短信中心接口</option>
							</select>
						</td>
						</tr>
						<tr align="right">
						<td></td>
							<td>
								<input type="submit" class="short-button" value="查  询" onclick="search()"/>
							</td>
						</tr>
				</table>
			</fieldset>
			<table width="90%" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td>
						<input type="button" class="short-button" value="新  增" onclick="javascript:window.location='/admin/jsp/sys_mgr/sys_com/sys_com_add.jsp'" />
						&nbsp;&nbsp;&nbsp;
						<input type="button" class="short-button" value="批量删除" onclick="delSysComs()" />
					</td>
				</tr>
			</table>
			<table id="tableList" cellspacing="1" class="tablesorter" width="90%">
				<thead>
					<tr align="center">						
						<th class="{sorter: false}" width="4%">
							<input class="checkbox" type="checkbox" name="operid" onclick="javascript:selectAll('id',this.checked)">
						</th>	
						<th>
							接口名称
						</th>			
						<th>
							<a href="javascript:sort('comType','asc')">接口类型</a>
						</th>
						<th>
							<a href="javascript:sort('comDesc','asc')">接口描述</a>
						</th>
						<th class="{sorter: false}">
							操作
						</th>
					</tr>
				</thead>
				<tbody>
				<c:if test="${page.totalCount != '0'}">
						<c:forEach var="com" items="${page.result}" varStatus="status">
							<tr align="center">								
								<td>
									<input class="checkbox" type="checkbox" name="id" value="<c:out value='${com.id}' />" />
								</td>
								<td>
									<c:out value="${com.comName}" />
								</td>
								<td>
									<c:if test="${com.comType==1}">DSMP接口</c:if>
									<c:if test="${com.comType==2}">彩信中心接口</c:if>
									<c:if test="${com.comType==3}">短信中心接口</c:if>
								</td>
								<td>
									<c:out value="${com.comDesc}" />
								<td>
									<img src="../images/modp.gif" title="修改" style="cursor: pointer" onclick="editSysCom(<c:out value='${com.id}' />)">
									<img src="../images/detail.gif" title="参数查看" style="cursor: pointer" onclick="viewSysComParam(<c:out value='${com.id}' />)">
									<img src="../images/delp.gif" title="删除" style="cursor: pointer" onclick="delSysCom(<c:out value='${com.id}' />)">
								</td>
							</tr>
						</c:forEach>
					</c:if>
					<c:if test="${page.totalCount == '0'}">
						<tr align="center">
							<td colspan="4" align="left">
								暂无符合条件的记录



							</td>
						</tr>
				</c:if>
				</tbody>
			</table>
			<div>
				<jsp:include page="/framework/jsp/pager.jsp" flush="true" />
			</div>
		</form>
	</body>
	<script type="text/javascript">
	function init()
	{
		var comType = "${param['filter_EQ_comType']}";
		document.getElementById("comType").value = comType;
	}
	
	//查询
	function search(){
			$("#order").val("desc");
			$("#orderBy").val("comName");
			$("#pageNo").val("1");
			$("#pageSize").val("5");
			$("#mainForm").submit();
	}
	
	function viewSysComParam(id){
		window.location='/admin/jsp/sysCom.do?method=viewSysComParam&id='+id;
	}
	//编辑接口
	function editSysCom(id){
		window.location='/admin/jsp/sysCom.do?method=editSysCom&id='+id;
	}
	
	//删除终端参数

	function delSysCom(id){
		if(confirm('您确定删除该接口参数吗？'))
			window.location='/admin/jsp/sysCom.do?method=delSysCom&id='+id;
	}
	
	//批量删除接口参数

	function delSysComs(){
		if(getCheckboxCheckedValue("id") != ""){
			if(confirm("您确定删除所选接口参数吗?\n")==true){					
				document.getElementById("mainForm").action = "/admin/jsp/sysCom.do?method=delSysComs";
				document.getElementById("mainForm").submit();
			}
		}else{
			alert("请选择需要删除的接口参数！");
		}
	}
	
	</script>
</html>